{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body">
                        <div class="form-group">
                            <label for="task_id" class="col-sm-2 control-label">主任务ID</label>
                            <div class="col-sm-10 col-md-4">
                                <div class="input-group">
                                    <input id="task_id" name="task_id" value="{$data.task_id|default='0'}" placeholder="请输入主任务id" type="number" readonly class="form-control field-number">
                                </div>
                            </div>
                        </div>
                        <!--<script>-->
                            <!--$('#task_id')-->
                                <!--.bootstrapNumber({-->
                                    <!--upClass: 'success',-->
                                    <!--downClass: 'primary',-->
                                    <!--center: true-->
                                <!--});-->
                        <!--</script>-->
                        <div class="form-group">
                            <label for="uid" class="col-sm-2 control-label">粉丝ID</label>
                            <div class="col-sm-10 col-md-4">
                                <div class="input-group">
                                    <input id="uid" name="uid" value="{$data.uid|default='0'}" placeholder="请输入粉丝id" type="number" readonly class="form-control field-number">
                                </div>
                            </div>
                        </div>
                        <!--<script>-->
                            <!--$('#uid')-->
                                <!--.bootstrapNumber({-->
                                    <!--upClass: 'success',-->
                                    <!--downClass: 'primary',-->
                                    <!--center: true-->
                                <!--});-->
                        <!--</script>-->
                        <div class="form-group">
                            <label for="task_no" class="col-sm-2 control-label">子任务编号</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="task_no" name="task_no" value="{$data.task_no|default=''}" placeholder="请输入子任务编号" type="text" readonly class="form-control field-text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="order_time" class="col-sm-2 control-label">购买日期</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="order_time" readonly name="order_time" value="{$data.order_time|default=''}" placeholder="请选择购买日期" type="text" class="form-control filed-datetime">
                            </div>
                        </div>
                        <script>
                            laydate.render({
                                // elem: '#order_time',
                                type: 'datetime',
                            });
                        </script>
                        <div class="form-group">
                            <label for="pic" class="col-sm-2 control-label">二维码链接</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="pic" name="pic" value="{$data.pic|default=''}" placeholder="前台生成的二维码" type="text" class="form-control field-text" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="url" class="col-sm-2 control-label">链接</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="url" name="url" value="{$data.url|default=''}" placeholder="请输入链接" type="text" class="form-control field-map">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="order_no" class="col-sm-2 control-label">订单编号</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="order_no" name="order_no" value="{$data.order_no|default=''}" placeholder="请输入订单编号" type="text" class="form-control field-text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                状态
                                <!--0 未打款 1 已转款-->
                            </label>
                            <div class="col-sm-10 col-md-4" style="padding:5px;">&nbsp;
                                <input type="radio" name="is_cash" value="0" {if isset($data) && $data.is_cash==0} checked {/if} />&nbsp;未打款&nbsp;
                                <input type="radio" name="is_cash" value="1" {if isset($data) && $data.is_cash==1} checked {/if} />&nbsp;已转款
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="cash_time" class="col-sm-2 control-label">打款时间</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="cash_time" readonly name="cash_time" value="{$data.cash_time|default=''}" placeholder="请选择打款时间" type="text" class="form-control filed-datetime">
                            </div>
                        </div>
                        <script>
                            laydate.render({
                                // elem: '#cash_time',
                                type: 'datetime',
                            });
                        </script>
                        <div class="form-group">
                            <label for="trans_num" class="col-sm-2 control-label">换手次数</label>
                            <div class="col-sm-10 col-md-4">
                                <div class="input-group">
                                    <input id="trans_num" name="trans_num" value="{$data.trans_num|default='0'}" placeholder="请输入换手次数" type="number" class="form-control field-number" readonly>
                                </div>
                            </div>
                        </div>
                        <!--<script>-->
                            <!--$('#trans_num')-->
                                <!--.bootstrapNumber({-->
                                    <!--upClass: 'success',-->
                                    <!--downClass: 'primary',-->
                                    <!--center: true-->
                                <!--});-->
                        <!--</script>-->
                        <div class="form-group">
                            <label for="delay_num" class="col-sm-2 control-label">延时次数</label>
                            <div class="col-sm-10 col-md-4">
                                <div class="input-group">
                                    <input id="delay_num" name="delay_num" value="{$data.delay_num|default='0'}" placeholder="请输入延时次数" type="number" class="form-control field-number">
                                </div>
                            </div>
                        </div>
                        <!--<script>-->
                            <!--$('#delay_num')-->
                                <!--.bootstrapNumber({-->
                                    <!--upClass: 'success',-->
                                    <!--downClass: 'primary',-->
                                    <!--center: true-->
                                <!--});-->
                        <!--</script>-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">
                                状态
                                <!--0 未提交 1进行中  2已完成-->
                            </label>
                            <div class="col-sm-10 col-md-4" style="padding:5px;">&nbsp;
                                <input type="radio" name="status" value="0" {if isset($data) && $data.status==0} checked {/if} />&nbsp;未提交&nbsp;
                                <input type="radio" name="status" value="1" {if isset($data) && $data.status==1} checked {/if} />&nbsp;进行中&nbsp;
                                <input type="radio" name="status" value="2" {if isset($data) && $data.status==2} checked {/if} />&nbsp;已完成&nbsp;
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="cash_time" class="col-sm-2 control-label">创建时间</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="create_time" readonly name="create_time" value="{$data.create_time|default=''}" placeholder="" type="text" class="form-control filed-datetime">
                            </div>
                        </div>
                        <script>
                            laydate.render({
                                // elem: '#create_time',
                                type: 'datetime',
                            });
                        </script>

                    </div>
                    <!-- 表单底部 -->
                    <div class="box-footer">
                        {:token()}
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            {if !isset($data)}
                            <div class="btn-group pull-right">
                                <label class="createContinue">
                                    <input type="checkbox" value="1" id="_create" name="_create"
                                           title="继续添加数据">继续添加</label>
                            </div>
                            {/if}
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    保存
                                </button>
                            </div>
                            <div class="btn-group">
                                <button type="reset" class="btn flat btn-default dataFormReset">
                                    重置
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
            'task_no': {
                required: true,
            },
            'order_time': {
                required: true,
            },
            'order_no': {
                required: true,
            },
            'cash_time': {
                required: true,
            },

        },
        messages: {
            'task_no': {
                required: "子任务编号不能为空",
            },
            'order_time': {
                required: "购买日期不能为空",
            },
            'order_no': {
                required: "订单编号不能为空",
            },
            'cash_time': {
                required: "打款时间不能为空",
            },

        }
    });
</script>
{/block}